using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeocodingTools
{
    /// <summary>
    /// <para>Reverse Geocode</para>
    /// <para>Creates addresses from point locations in a feature class. The reverse geocoding process searches for the nearest address or intersection for the point location based on the specified search distance. When using the ArcGIS World Geocoding Service, this operation may consume credits.</para>
    /// <para>从要素类中的点位置创建地址。反向地理编码过程根据指定的搜索距离搜索点位置的最近地址或交点。使用 ArcGIS World Geocoding Service 时，此操作可能会消耗配额。</para>
    /// </summary>    
    [DisplayName("Reverse Geocode")]
    public class ReverseGeocode : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ReverseGeocode()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Feature Class or layer</para>
        /// <para>A point feature class or layer from which matching places or addresses will be returned based on the features' point location.</para>
        /// <para>点要素类或图层，将根据要素的点位置从中返回匹配的地点或地址。</para>
        /// </param>
        /// <param name="_in_address_locator">
        /// <para>Input Address Locator</para>
        /// <para>The locator that will be used to reverse geocode the input feature class or layer.</para>
        /// <para>将用于对输入要素类或图层进行反向地理编码的定位器。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class.</para>
        /// <para>输出要素类。</para>
        /// </param>
        /// <param name="_search_distance">
        /// <para>Search Distance</para>
        /// <para><xdoc>
        ///   <para>The distance that will be used to search for the nearest address or intersection for the point location. Some locators use optimized distance values that do not support overriding the search distance parameter.</para>
        ///   <para>This parameter only applies to locators built with the Create Address Locator tool or composite locators that contain locators built with the Create Address Locator tool.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于搜索点位置的最近地址或交点的距离。某些定位器使用不支持覆盖搜索距离参数的优化距离值。</para>
        ///   <para>此参数仅适用于使用创建地址定位器工具构建的定位器或包含使用创建地址定位器工具构建的定位器的复合定位器。</para>
        /// </xdoc></para>
        /// </param>
        public ReverseGeocode(object _in_features, object _in_address_locator, object _out_feature_class, string _search_distance)
        {
            this._in_features = _in_features;
            this._in_address_locator = _in_address_locator;
            this._out_feature_class = _out_feature_class;
            this._search_distance = _search_distance;
        }
        public override string ToolboxName => "Geocoding Tools";

        public override string ToolName => "Reverse Geocode";

        public override string CallName => "geocoding.ReverseGeocode";

        public override List<string> AcceptEnvironments => ["outputCoordinateSystem"];

        public override object[] ParameterInfo => [_in_features, _in_address_locator, _out_feature_class, _address_type.GetGPValue(), _search_distance, _feature_type, _location_type.GetGPValue()];

        /// <summary>
        /// <para>Input Feature Class or layer</para>
        /// <para>A point feature class or layer from which matching places or addresses will be returned based on the features' point location.</para>
        /// <para>点要素类或图层，将根据要素的点位置从中返回匹配的地点或地址。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Feature Class or layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Input Address Locator</para>
        /// <para>The locator that will be used to reverse geocode the input feature class or layer.</para>
        /// <para>将用于对输入要素类或图层进行反向地理编码的定位器。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Address Locator")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_address_locator { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class.</para>
        /// <para>输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Output Address Type</para>
        /// <para><xdoc>
        ///   <para>Specifies whether addresses for the points will be returned as street addresses or intersection addresses if the locator supports intersection matching.</para>
        ///   <para>This parameter only applies to locators built with the Create Address Locator tool or composite locators that contain locators built with the Create Address Locator tool.</para>
        ///   <bulletList>
        ///     <bullet_item>Address—Addresses will be returned as street addresses or in the format defined by the input address locator. This is the default.</bullet_item><para/>
        ///     <bullet_item>Intersection—Addresses will be returned as intersection addresses. This option is available if the address locator supports matching intersection addresses.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如果定位器支持交叉点匹配，则是将点的地址返回为街道地址还是交叉点地址。</para>
        ///   <para>此参数仅适用于使用创建地址定位器工具构建的定位器或包含使用创建地址定位器工具构建的定位器的复合定位器。</para>
        ///   <bulletList>
        ///     <bullet_item>地址—地址将作为街道地址或输入地址定位器定义的格式返回。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>相交点—地址将作为相交点地址返回。如果地址定位器支持匹配的交叉点地址，则此选项可用。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Address Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _address_type_value _address_type { get; set; } = _address_type_value._ADDRESS;

        public enum _address_type_value
        {
            /// <summary>
            /// <para>Address</para>
            /// <para>Address—Addresses will be returned as street addresses or in the format defined by the input address locator. This is the default.</para>
            /// <para>地址—地址将作为街道地址或输入地址定位器定义的格式返回。这是默认设置。</para>
            /// </summary>
            [Description("Address")]
            [GPEnumValue("ADDRESS")]
            _ADDRESS,

            /// <summary>
            /// <para>Intersection</para>
            /// <para>Intersection—Addresses will be returned as intersection addresses. This option is available if the address locator supports matching intersection addresses.</para>
            /// <para>相交点—地址将作为相交点地址返回。如果地址定位器支持匹配的交叉点地址，则此选项可用。</para>
            /// </summary>
            [Description("Intersection")]
            [GPEnumValue("INTERSECTION")]
            _INTERSECTION,

        }

        /// <summary>
        /// <para>Search Distance</para>
        /// <para><xdoc>
        ///   <para>The distance that will be used to search for the nearest address or intersection for the point location. Some locators use optimized distance values that do not support overriding the search distance parameter.</para>
        ///   <para>This parameter only applies to locators built with the Create Address Locator tool or composite locators that contain locators built with the Create Address Locator tool.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于搜索点位置的最近地址或交点的距离。某些定位器使用不支持覆盖搜索距离参数的优化距离值。</para>
        ///   <para>此参数仅适用于使用创建地址定位器工具构建的定位器或包含使用创建地址定位器工具构建的定位器的复合定位器。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Distance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string _search_distance { get; set; }


        /// <summary>
        /// <para>Feature Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the possible match types that will be returned. A single value or multiple values can be selected. If a single value is selected, the search tolerance for the input feature type is 500 meters. If multiple values are included, the default search distances specified in the feature type hierarchy table will be applied.</para>
        ///   <para>This parameter is not supported for all locators.</para>
        ///   <bulletList>
        ///     <bullet_item>Subaddress—The match will be limited to a street address based on points that represent house and building subaddress locations.</bullet_item><para/>
        ///     <bullet_item>Point Address—The match will be limited to a street address based on points that represent house and building locations.</bullet_item><para/>
        ///     <bullet_item>Parcel—The match will be limited to a plot of land that is considered real property and can include one or more homes or other structures. This match type typically has an address and a parcel identification number assigned to it.</bullet_item><para/>
        ///     <bullet_item>Street Address—The match will be limited to a street address that differs from Point Address because the house number is interpolated from a range of numbers. Street Address matches include the house number range for the matching street segment rather than the interpolated house number value.</bullet_item><para/>
        ///     <bullet_item>Street Intersection— The match will be limited to a street address consisting of a street intersection along with city and optional state and postal code information. This is derived from Street Address reference data, for example, Redlands Blvd & New York St, Redlands, CA, 92373.</bullet_item><para/>
        ///     <bullet_item>Street Name—The match will be limited to a street address similar to Street Address but without house numbers along with administrative divisions and optional postal code, for example, W Olive Ave, Redlands, CA, 92373 .</bullet_item><para/>
        ///     <bullet_item>Locality—The match will be limited to a place-name representing a populated place.</bullet_item><para/>
        ///     <bullet_item>Postal—The match will be limited to a postal code. Reference data is postal code points, for example, 90210 USA.</bullet_item><para/>
        ///     <bullet_item>Point of Interest—The match will be limited to a point of interest. Reference data consists of administrative division place-names, businesses, landmarks, and geographic features, for example, Starbucks.</bullet_item><para/>
        ///     <bullet_item>Distance Marker— The match will be limited to a street address that represents the linear distance along a street, typically in kilometers or miles, from a designated origin location, for example, Mile 25 I-5 N, San Diego, CA.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将返回的可能匹配类型。可以选择单个值或多个值。如果选择单个值，则输入要素类型的搜索容差为 500 米。如果包含多个值，则将应用要素类型层次结构表中指定的默认搜索距离。</para>
        ///   <para>并非所有定位器都支持此参数。</para>
        ///   <bulletList>
        ///     <bullet_item>子地址 - 匹配将限制为基于表示房屋和建筑物子地址位置的点的街道地址。</bullet_item><para/>
        ///     <bullet_item>点地址 - 匹配将仅限于基于代表房屋和建筑物位置的点的街道地址。</bullet_item><para/>
        ///     <bullet_item>宗地 - 匹配将仅限于被视为不动产的地块，并且可以包括一个或多个房屋或其他构筑物。此匹配类型通常具有分配给它的地址和包裹标识号。</bullet_item><para/>
        ///     <bullet_item>街道地址 - 匹配将限制为与点地址不同的街道地址，因为门牌号是从一系列数字中插值而来的。街道地址匹配项包括匹配街道段的门牌号范围，而不是插值的门牌号值。</bullet_item><para/>
        /// <bullet_item>街道交叉口 — 匹配将仅限于街道地址，该街道地址由街道交叉口以及城市和可选的州和邮政编码信息组成。这是从街道地址参考数据派生的，例如，Redlands Blvd & New York St， Redlands， CA， 92373。</bullet_item><para/>
        ///     <bullet_item>街道名称 - 匹配将仅限于与街道地址相似的街道地址，但没有门牌号以及行政区划和可选邮政编码，例如，W Olive Ave， Redlands， CA， 92373 。</bullet_item><para/>
        ///     <bullet_item>位置 - 匹配将仅限于表示人口稠密地点的地名。</bullet_item><para/>
        ///     <bullet_item>邮政 - 匹配将仅限于邮政编码。参考数据是邮政编码点，例如，90210 USA。</bullet_item><para/>
        ///     <bullet_item>兴趣点 - 匹配将仅限于一个兴趣点。参考数据包括行政区划地名、企业、地标和地理要素，例如星巴克。</bullet_item><para/>
        ///     <bullet_item>距离标记 — 匹配将仅限于一个街道地址，该地址表示从指定起点位置（例如，加利福尼亚州圣地亚哥市 Mile 25 I-5 N）沿街道的线性距离（通常以公里或英里为单位）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Feature Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _feature_type { get; set; } = null;


        /// <summary>
        /// <para>Preferred Location Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the preferred output geometry for Point Address matches. The options for this parameter are a side of street location, which can be used for routing, or the location that represents the rooftop or parcel centroid for the address. If the preferred location does not exist in the data, the default location will be returned instead. For geocode results with Addr_type=PointAddress, the x,y attribute values describe the coordinates of the address along the street, while the DisplayX and DisplayY values describe the rooftop or building centroid coordinates.</para>
        ///   <para>This parameter is not supported for all locators.</para>
        ///   <bulletList>
        ///     <bullet_item>Address location—Geometry for geocode results that represent an address location such as rooftop, building centroid, or front door is returned will be returned.</bullet_item><para/>
        ///     <bullet_item>Routing location—Geometry for geocode results that represent a location close to the side of the street, which can be used for vehicle routing, will be returned. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定点地址匹配的首选输出几何。此参数的选项是可用于路径规划的街道位置的一侧，或表示地址的屋顶或宗地质心的位置。如果数据中不存在首选位置，则将改为返回默认位置。对于具有 Addr_type=PointAddress 的地理编码结果，x，y 属性值描述沿街道的地址坐标，而 DisplayX 和 DisplayY 值描述屋顶或建筑物质心坐标。</para>
        ///   <para>并非所有定位器都支持此参数。</para>
        ///   <bulletList>
        ///     <bullet_item>地址位置 - 将返回表示地址位置（如屋顶、建筑物质心或前门）的地理编码结果的几何。</bullet_item><para/>
        ///     <bullet_item>路径定位 - 将返回表示靠近街道一侧的位置的地理编码结果的几何图形，该位置可用于车辆配送。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preferred Location Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _location_type_value _location_type { get; set; } = _location_type_value._ROUTING_LOCATION;

        public enum _location_type_value
        {
            /// <summary>
            /// <para>Routing location</para>
            /// <para>Routing location—Geometry for geocode results that represent a location close to the side of the street, which can be used for vehicle routing, will be returned. This is the default.</para>
            /// <para>路径定位 - 将返回表示靠近街道一侧的位置的地理编码结果的几何图形，该位置可用于车辆配送。这是默认设置。</para>
            /// </summary>
            [Description("Routing location")]
            [GPEnumValue("ROUTING_LOCATION")]
            _ROUTING_LOCATION,

            /// <summary>
            /// <para>Address location</para>
            /// <para>Address location—Geometry for geocode results that represent an address location such as rooftop, building centroid, or front door is returned will be returned.</para>
            /// <para>地址位置 - 将返回表示地址位置（如屋顶、建筑物质心或前门）的地理编码结果的几何。</para>
            /// </summary>
            [Description("Address location")]
            [GPEnumValue("ADDRESS_LOCATION")]
            _ADDRESS_LOCATION,

        }

        public ReverseGeocode SetEnv(object outputCoordinateSystem = null)
        {
            base.SetEnv(outputCoordinateSystem: outputCoordinateSystem);
            return this;
        }

    }

}